﻿namespace System
{
    public static class NullableExtensions
    {
        public static T Default<T>(this T? input, T defaultValue)
            where T : struct
        {
            return input == null ? defaultValue : input.Value;
        }

        public static T Default<T>(this T? input)
            where T : struct
        {
            return input == null ? default(T) : input.Value;
        }
    }
}